package main

import (
	"fmt"
	"os"
	"strconv"
)

func son (f float64, m float64) float64 {
	return (f + m) * 1.08 / 2
}

func daughter(f float64, m float64) float64 {
	return (f * 0.923 + m ) / 2
}

func main() {
	if len(os.Args) != 4 {
		fmt.Println("tall S/D Father Mother")
		os.Exit(1)
	}

	f_tall, ferr := strconv.ParseFloat(os.Args[2], 64)
	if ferr != nil {
		fmt.Println("Error: ", ferr)
		os.Exit(1)
	}

	m_tall, merr := strconv.ParseFloat(os.Args[3], 64)
	if merr != nil {
		fmt.Println("Error: ", merr)
		os.Exit(1)
	}

	switch os.Args[1] {
	case "s":
		fmt.Printf("The tall of SON is: %.2f\n", son(f_tall, m_tall))
	case "d":
		fmt.Printf("The tall of DAUGHTER is: %.2f\n", daughter(f_tall, m_tall))
	default:
		fmt.Println("tall S/D Father Mother")
		os.Exit(1)
	}
}